<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>  
<%
	String path = request.getContextPath();
%>	
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="copyright" content=""/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
	<title>设置-个人资料</title>
	<link href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
	<link href="${pageContext.request.contextPath}/css/system/public.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/system/set.css" /> 
	<link href="../favicon.ico" rel="shortcut icon">
	<!--提示框 -->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/system/alert.css" />
    <!--  -->
	
<!-- 	<script type="text/javascript" src="../sys/set/bootstarp/jquery-form.js"></script> -->
	<script src="${pageContext.request.contextPath}/hplus/js/jquery.min.js?v=2.1.4"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/system/exit.js"></script>
	<link href="<%=path%>/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
	<link href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
	<link href="<%=path%>/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="<%=path%>/hplus/css/animate.min.css" rel="stylesheet">
	<link href="<%=path%>/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
   <div class="wrapper wrapper-content animated fadeInRight">
    <div class="row" >
		 <div class="col-md-12" id = "resetpassword" style="width:100%;height: 100%;z-index: 9999;background: rgba(0,0,0,.3);
              display: none;position: fixed;" >
                <div id = "reset_password" style="background: #fff;position: fixed;z-index:9999; left: 35%;
                 top: 20%;width: 400px; border-radius: 3px; text-align: center; border-top: 4px solid #03a9f4;
                 padding: 30px 2%;display: none;">
                  <div ><span><img id = "i_close" style="cursor:pointer;float: right;" src="${pageContext.request.contextPath}/images/system/close.png" /></span>
                  <h4 style="font-size: 20px;margin-bottom: 30px;color: #333;background: #fff;">修改密码</h4></div>
                  <div>
                  <span style="margin-left:40px;line-height: 50px;font-size: 15px;color: #666;">旧密码</span> 
                  <input  style="width: 70%;height: 40px;line-height:50px;border: 1px solid #d2d2d2;padding-left: 10px;border-radius: 3px;" 
                  type="password" name ="old_password"  id ="old_password" placeholder="请输入旧密码"/>
                  </div>
                  <div>
                  <span style="line-height:50px;font-size: 15px;color: #666;">请输入新密码</span>
                  <input style="width: 70%;height: 40px;line-height:50px;border: 1px solid #d2d2d2;padding-left: 10px;border-radius: 3px;" 
                   type="password" name = "newpassword"  id = "newpassword" placeholder="请输入新密码"/>
                  </div>
                  <div>
                  <span style="margin-left: 30px;line-height:50px;font-size: 15px;color: #666;">确认密码</span>
                  <input style="width: 70%;height: 40px;line-height:50px;border: 1px solid #d2d2d2;padding-left: 10px;border-radius: 3px;" 
                   type="password"  name = "new_password" id = "new_password" placeholder="请再一次确认密码"/>
                  </div>
                  <div style="margin-top: 30px;">
                  <span><a id = "b_close" href="javascript:;" style="margin-left:80px;color: #03a9f4;float: left;width: 100px;height: 40px;line-height: 40px;text-align: center;
                    border: 1px solid #03a9f4;background: #fff;border-radius: 3px;
                  ">取消</a></span>
                  <span><a href="javascript:;" style="margin-right:30px;background: #03a9f4;float: right;width: 100px;height: 40px;
                    line-height: 40px;text-align: center;border: 1px solid #03a9f4;border-radius: 3px;" id = "commit">确定</a></span>
                  </div>
                </div>
              </div>  
            <div class="s_basics col-md-12">
	             <div class="col-md-12">
				   <div class="ibox">
				    <div class="ibox-content text-right">
				      <button id="create_model" type="button" class="btn btn-primary s_change_btns" >修改密码</button>
				    </div>
				   </div>   
				 </div> 
                <ul class="s_basics_list k_grzl col-md-12">
                    <li><span>姓名</span><p id ="P_name"></p></li>
                    <li><span >电话</span><p id = "P_phone">&nbsp;&nbsp;
                   <a href="javascript:;" class="s_change_btn">更改</a>
                   </p> </li>
                    <li><span>邮件</span><p id = "P_email"></p></li>
                    <li><span>行业</span><p id = "P_industry"></p></li>
                    <li><span>部门</span><p id = "P_Department"></p></li>
                    <li><span>职位</span><p id = "P_job"></p></li>
                    <li><span>角色</span><p id = "P_role"></p></li>
                    <li style="display: none;"><span id = "P_hobby">个人兴趣爱好</span>
                        <div class="form s_keyword fix">
                            <input type="text" placeholder="自定义" />
                            <span>按Enter确认，不超过3个</span>
                            <em>已输入3个，最多输入3个</em>
                        </div>
                        <ol class="key fix">
                            <li class="s_fx_li1">
                                <img src="${pageContext.request.contextPath}/images/system/s_check.png" class="s_fk_pic1" _id="1" name = "宠物" />宠物
                            </li>
                            <li class="s_fx_li2">
                                <img src="${pageContext.request.contextPath}/images/system/s_check.png" class="s_fk_pic2" _id="3" name = "植物"/>植物
                            </li>
                            <li class="s_fx_li3">
                                <img src="${pageContext.request.contextPath}/images/system/s_check.png" class="s_fk_pic3" _id="5" name = "户外"/>户外
                            </li>
                            <li class="s_fx_li4">
                                <img src="${pageContext.request.contextPath}/images/system/s_check.png" class="s_fk_pic4" _id="7" name = "电影"/>电影
                            </li>
                            <li class="s_fx_li5">
                                <img src="${pageContext.request.contextPath}/images/system/s_check.png" class="s_fk_pic5" _id="9" name = "美食"/>美食
                            </li>
                        </ol>
                    </li>
                </ul>
            </div>
        </div>
   </div>
  <!-- 提示框 -->
  <div class="s_popup_delect2" style="z-index: 99999999999">
  <div class="s_consum">
      <p id="dialog_title"><img src="../bm/images/s_tick.png" > </p >
  </div>
  </div>
  <!--  -->
    
    
    <!-- 更改电话号码 -->
    <div class="s_popup">
        <div class="issue s_issue">
            <span><img src="${pageContext.request.contextPath}/images/system/close.png" /></span>
            <h4>更改电话号码</h4>
            <ul class="fix">
                <li><span>旧号码</span><p id ="old_Phone"></p></li>
                <li class="code">
                    <span>输入验证码</span>
                    <div class="s_input_box">           
                        <input type="text" />   
                    </div>     
                    <input type="button" value="获取验证码" class="s_codes J_xcodes">
                </li>
                <li>
                    <span>新号码</span>
                    <div class="s_input_box">
                        <input type="text" id ="new_mobil" />
                    </div>
                </li>
                <li class="code">
                    <span>输入验证码</span>
                    <div class="s_input_box">           
                        <input type="text" id = "new_ver_code" />   
                    </div>     
                    <input type="button" value="获取验证码" class="s_codes J_xcode">
                </li>
            </ul>
            <ol class="fix">
                <li><a style="width: 100px;height: 40px;display: block;" href="javascript:;" class="s_cancel">取消</a></li>
                <li><a style="width: 100px;height: 40px;display: block;" href="javascript:;" class="s_confirm">确定</a></li>
            </ol>
        </div>
    </div>
    <!-- 更改电话号码成功 -->
    <div class="s_popup_box">
        <div class="s_popup_detailed">
            <span><img src="${pageContext.request.contextPath}/images/system/close.png" /></span>
            <h4><img src="${pageContext.request.contextPath}/images/system/icon_hint.png" /> 更改电话号码成功</h4>
            <h5>电话号码更改成功</h5>
            <h5>登录手机号变更为<i>15810514282</i></h5>
            <p><a href="javascript:;">完成</a></p>
        </div>
    </div>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/marketing/InputLimitedByidandlength.js"></script>
    <script>
    $(function(){
    	inputlimited("#new_mobil",15);
    });
    /* 提示框 */
    function showDialog(title){
    	
    	$('#dialog_title').html('<img src="../bm/images/s_tick.png" >'+title+''); 
    	$('.s_popup_delect2,.s_consum').show().delay(2000).fadeOut();
    }
    /*  */
    
    
    
    $(function(){
	$('#newpassword').blur(function(){
		//用户输入的密码
		var password=$('#newpassword').val();
		if(password==null || password==""){
			   return;
		    }
		//正则表达式,必须要有数字和字母，为6到10位
		var reg=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,10}$/;
		//判断
		 if(!reg.test(password)){
		     //$('#zc_pwd').focus();
		     document.getElementById("newpassword").value="";
		 	showDialog("不符合规范,必须要有数字和字母,长度为6-10位字符");
		}
	});
	$('#new_password').blur(function(){
		//用户输入的密码
		var password=$('#new_password').val();
		if(password==null || password==""){
			   return;
		    }
		//正则表达式,必须要有数字和字母，为6到10位
		var reg=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,10}$/;
		//判断
		 if(!reg.test(password)){
		     //$('#zc_pwd').focus();
		     document.getElementById("new_password").value="";
		 	showDialog("不符合规范,必须要有数字和字母");
		}
	});
})
    
    
    /*修改密码  */
    $(function(){
    	  $('#old_password').val("");
  		  $('#newpassword').val("");
  		  $('#new_password').val("");
  		  $('.s_change_btns').click(function(){
  			  $('#resetpassword').removeClass("hide");
  			  $('#resetpassword').addClass("show");
  			  $('#reset_password').removeClass("hide");
  			  $('#reset_password').addClass("show");
  			 
  		  });
  	 
  	 $('#b_close').click(function(){
  		  $('#old_password').val("");
  		  $('#newpassword').val("");
  		  $('#new_password').val("");
  		  $('#resetpassword').removeClass("show");
  		  $('#resetpassword').addClass("hide");
  		  $('#reset_password').removeClass("show");
  		  $('#reset_password').addClass("hide");
  	 });
  	 $('#i_close').click(function(){
  		  $('#old_password').val("");
  		  $('#newpassword').val("");
  		  $('#new_password').val("");
  		  $('#resetpassword').removeClass("show");
  		  $('#resetpassword').addClass("hide");
  		  $('#reset_password').removeClass("show");
  		  $('#reset_password').addClass("hide");
  	 });
  	 
  	 $('#commit').click(function(){
  		 if (( $('#old_password').val())!=null&&( $('#old_password').val())!="") {
			if (( $('#newpassword').val())!=null&&( $('#newpassword').val())!=""&&
					( $('#new_password').val())!=null&&( $('#new_password').val())!="") {
				var old_password = $('#old_password').val().trim();
				var new_password = $('#newpassword').val().trim();
				var new_two_password = $('#new_password').val().trim();
				
				if (old_password!=new_password) {
				if (new_password==new_two_password) {
					 $.ajax({
		         		  url: "${pageContext.request.contextPath}/api/self_info/update_password",

		         		  type: "post",
		         		  
		         		  async: true,

		         		  data:{"old_password":old_password,"new_password":new_password},

		         		  dataType: "json",

		         		  timeout: 1000,

		         		  error: function(){},

		         		  success: function(data){
		         			  if (data.status == 200) {
		         				
		         				showDialog(data.error_message);
		         				  $('#resetpassword').removeClass("show");
		         		  		  $('#resetpassword').addClass("hide");
		         		  		  $('#reset_password').removeClass("show");
		         		  		  $('#reset_password').addClass("hide");
		         		  		  
		         		  	   var path = getRootPath();
		                     	$.post(
		                     			path+"/api/login/exit",
		                     			{},
		                     			function(data){
		                     				if(data.error_code == "0"){
		                     					
		                     					setTimeout('window.location.href="http://cecook.cn/"',2000);
		                     				}
		                     			},
		                     			"json");
		         		  		  
							}else{
								
								showDialog(data.error_message);
							}
		         			
		         		  }
		                      
		         		  }); 
					}else {
					showDialog("两次输入的密码不一致");
				    }
				} else {
					showDialog("新密码不能与旧密码一致");
				}
			} else {
				showDialog("新密码不能为空");
			}
		}
  		 else {
  			showDialog("旧密码不能为空");
		}
  	 });
  	 
  	 
    });
    /*  */
    $('.s_keyword input').on('keydown',function(e){
            $(this).parents('.s_keyword').find('span').show();//显示隐藏的被选元素
            if(e.keyCode==13){
                var keyword = $.trim($('.s_keyword input').val());
                var html = "";
                var len = $('.key li').length;

                var newLen = $('.key li').length;
                if(len>=7){
                    $('.s_keyword input').hide();
                    $('.s_keyword em').show();
                }
                if(!keyword==""){
                    if(len>=8){
                        return false;
                    }
                    
                    if(keyword=="宠物"||keyword=="植物"||keyword=="户外"||keyword=="电影"||keyword=="美食"){
                    	showDialog("与原始数据重复");
                    }else{
                    	if ((keyword.length)<11) {
                    		html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+keyword+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
						} else {
							showDialog("输入长度不能超过10个字符");
						}
                    	
					}
                  
                    
                }
                $('.key').append(html);
                $('.s_keyword input').val('');
                $(this).parents('.s_keyword').find('span').hide();
            }
        });
        $('body').on('click','.k_del',function(){
            $('.form input').show();
            $('.s_keyword em').hide();
            $(this).parent().remove();
        });

        $('.s_confirm').click(function(){
        	 //alert("验证进入");
        	 var old_mobil = $(".fix>li>p").parent("li").find('p').text();
        	 var old_ver_code = $('.s_input_box>input').val();
        	
        	 if (old_ver_code!=null&&old_ver_code!="") {
        	 $.ajax({
        		  url: "${pageContext.request.contextPath}/api/sms/verification_code/verify",

        		  type: "post",
        		  
        		  async: false,

        		  data:{"account":old_mobil,"ver_code":old_ver_code,"code_type":"change_code"},
        		  
        		  cache:false, 

        		  dataType: "json",

        		  timeout: 1000,

        		  error: function(){},

        		  success: function(data){
        			//alert("code"+data.error_code);alert("msg"+data.message);
        			 if (data.error_code==0) {
						alert("旧号码验证码核对成功");
						var new_mobil = $('#new_mobil').val();
				        var new_ver_code =$('#new_ver_code').val();
			           
				        if (new_mobil!=null&&new_mobil!=""&&new_ver_code!=null&&new_ver_code!="") {
						
				        $.ajax({
			         		  url: "${pageContext.request.contextPath}/api/sms/verification_code/verify",

			         		  type: "post",
			         		  
			         		  async: false,

			         		  data:{account:new_mobil,ver_code:new_ver_code,code_type:"identity_code"},
			         		  
			         		  cache:false, 

			         		  dataType: "json",

			         		  timeout: 1000,

			         		  error: function(){},

			         		  success: function(data){
			         			 //alert("code"+data.error_code);alert("msg"+data.message);
			         			  if (data.error_code==0) {
									alert("新号码验证码核对成功");
									if (new_mobil==old_mobil) {
										 alert("新旧号码不能相同");
									} else {
										$.ajax({
							         		  url: "${pageContext.request.contextPath}/api/self_info/change_mobil",

							         		  type: "post",
							         		  
							         		  async: false,

	 						         		  data:{account:new_mobil},
							         		  
							         		  cache:false, 

							         		  dataType: "json",

							         		  timeout: 1000,

							         		  error: function(){},

							         		  success: function(data){ 
							         			  if (data.error_code==0) {
							         				var account =  $('#new_mobil').val() 
							         				$("h5>i").text(account);
							         			   
							         				 $('.s_popup').hide();
							                         $('.issue').hide();
							                         $('.s_popup_box').show();
							                         $('.s_popup_detailed').show();
							                         
							                      
							                         
												} else {
	                                                 alert(data.message);
												}
							         			  
							         			  }
							         		  }); 
									}
									
								} else {
									alert("新号码验证码核对失败");
								}
			         		  }
			                      
			         		  }); 
				    	
						} else {
                           alert("请输入新号码和验证码");
						}
				        
					} else {
						alert("旧号码验证码核对失败");
					}
        		  }
                     
        		  }); 
        	 
        	   }else {
				alert("请输入旧号码验证码");
			}
        })
        $('.s_change_btn').click(function(){
            $('.s_popup').show();
           
            $('.issue').show();
        })
        $('.s_popup .issue span').click(function(){
            $('.s_popup').hide();
            $('.issue').hide();
        });
        $('.s_popup_box .s_popup_detailed p').click(function(){
            $('.s_popup_box').hide();
            $('.s_popup_detailed').hide();
            window.location.reload();
        });
        $('.s_cancel').click(function(){
            $('.s_popup').hide();
            $('.issue').hide();
        });
        
        
//         $('.s_fx_li1').click(function(){
//           var id = $(this).find('img').attr('_id');
//             if(id == 1){
//               $('.s_fk_pic1').attr('src', '${pageContext.request.contextPath}/images/system/s_check_no.png');
//               $(this).find('img').attr('_id' , '2');
//             }else{
//               $('.s_fk_pic1').attr('src', '${pageContext.request.contextPath}/images/system/s_check.png');
//               $(this).find('img').attr('_id' , '1');
//             }
//         });
//         $('.s_fx_li2').click(function(){
//           var id = $(this).find('img').attr('_id');
//             if(id == 3){
//               $('.s_fk_pic2').attr('src', '${pageContext.request.contextPath}/images/system/s_check_no.png');
//               $(this).find('img').attr('_id' , '4');
//             }else{
//               $('.s_fk_pic2').attr('src', '${pageContext.request.contextPath}/images/system/s_check.png');
//               $(this).find('img').attr('_id' , '3');
//             }
//         });
//         $('.s_fx_li3').click(function(){
//           var id = $(this).find('img').attr('_id');
//             if(id == 5){
//               $('.s_fk_pic3').attr('src', '${pageContext.request.contextPath}/images/system/s_check_no.png');
//               $(this).find('img').attr('_id' , '6');
//             }else{
//               $('.s_fk_pic3').attr('src', '${pageContext.request.contextPath}/images/system/s_check.png');
//               $(this).find('img').attr('_id' , '5');
//             }
//         });
//         $('.s_fx_li4').click(function(){
//           var id = $(this).find('img').attr('_id');
//             if(id == 7){
//               $('.s_fk_pic4').attr('src', '${pageContext.request.contextPath}/images/system/s_check_no.png');
//               $(this).find('img').attr('_id' , '8');
//             }else{
//               $('.s_fk_pic4').attr('src', '${pageContext.request.contextPath}/images/system/s_check.png');
//               $(this).find('img').attr('_id' , '7');
//             }
//         });
//         $('.s_fx_li5').click(function(){
//           var id = $(this).find('img').attr('_id');
//             if(id == 9){
//               $('.s_fk_pic5').attr('src', '${pageContext.request.contextPath}/images/system/s_check_no.png');
//               $(this).find('img').attr('_id' , '10');
//             }else{
//               $('.s_fk_pic5').attr('src', '${pageContext.request.contextPath}/images/system/s_check.png');
//               $(this).find('img').attr('_id' , '9');
//             }
//         });
        //复选框触发
        $(document).on('click','.key>li>img',function(){
               		var src = $(this).attr("src");
               		if(src.indexOf("s_check_no")>0){
               			$(this).attr("src","../sys/register/images/s_check.png");
               		}else{
               			$(this).attr("src","../sys/register/images/s_check_no.png");
               		}
                });
           

        $('.J_xcode').click(function(){
            var $this = $(this),
                _this = this,
                i = 60;
            _this.disabled = 'disabled';
            clearInterval(repeat);
            var repeat = setInterval(function(){
                i--;
                if(i == 0){
                    _this.disabled = false;
                    $this.removeClass('gray').val('获取验证码');
                    clearInterval(repeat);
                }else{
                    $this.addClass('gray').val(i+'s后重新获取');
                }
            },1000);
            
          //发送短信
            //var new_mobil = document.getElementById("new_mobil").value;
          var new_mobil = $('#new_mobil').val();
           
            $.ajax({
         		  url: "${pageContext.request.contextPath}/api/sms/verification_code/send",

         		  type: "post",
         		  
         		  async: true,

         		  data:{account:new_mobil,code_type:"identity_code"},

         		  dataType: "json",

         		  timeout: 1000,

         		  error: function(){},

         		  success: function(data){
         			 alert(data.message);
         		  }
                      
         		  }); 
        })
        $('.J_xcodes').click(function(){
            var $this = $(this),
                _this = this,
                i = 60;
            _this.disabled = 'disabled';
            clearInterval(repeat);
            var repeat = setInterval(function(){
                i--;
                if(i == 0){
                    _this.disabled = false;
                    $this.removeClass('gray').val('获取验证码');
                    clearInterval(repeat);
                }else{
                    $this.addClass('gray').val(i+'s后重新获取');
                }
            },1000);
            //发送短信
            var old_mobil = $(".fix>li>p").parent("li").find('p').text();
            $.ajax({
         		  url: "${pageContext.request.contextPath}/api/sms/verification_code/send",

         		  type: "post",
         		  
         		  async: true,

         		  data:{account:old_mobil,code_type:"change_code"},

         		  dataType: "json",

         		  timeout: 1000,

         		  error: function(){},

         		  success: function(data){}
                      
         		  }); 
        })
        
       
        
        //updata个人爱好定时器
//         setInterval('Updata_Hobby()',10000);
//         function Updata_Hobby(){
//         	var Hobby = "";
//         	//var Count = 0;
//         	$(".key>li>img[src$='s_check_no.png']").each(function(){
//            //$表示匹配字符串
//         		Hobby += $(this).parent().text().trim()+",";
//                 //Count++;
//         	});
        	
//         	 var strs= new Array(); //定义一数组  
//         	 strs= Hobby.split(",");
//         	 var s = strs.join(",")+",";
// 			 for(var i=0;i<strs.length-1;i++) {
// 			 if(s.replace(strs[i]+",","").indexOf(strs[i]+",")>-1) {
// 				 showDialog("发现爱好存在重复数据，已自动清除!!");
// 			 //alert("发现爱好存在重复数据，已自动清除!!");
// 			 break;
// 			 } 
// 			 }
			 
			 
//         	 $.ajax({
//        		  url: "${pageContext.request.contextPath}/api/self_info/Updata_Hobby",

//        		  type: "post",
       		  
//        		  async: false,

//        		  data:{hobby:Hobby},

//        		  dataType: "json",

//        		  timeout: 1000,

//        		  error: function(){},

//        		  success: function(data){
//        			var returndata = eval(data);
//                 if (returndata.error_code==0) {
//                 	//window.location.reload();
// 				}
//        		  }
       		  
//        		  }); 

//         }
        //个人资料数据回显
      $(function(){
    	  
    	
    	  
    	   $.ajax({
    		  url: "${pageContext.request.contextPath}/api/self_info/SelectById",

    		  type: "post",
    		  
    		  async: false,

    		  //data:{Name:"test"},
    		  
    		  cache:false, 

    		  dataType: "json",

    		  timeout: 1000,

    		  error: function(){},

    		  success: function(data){
    			  
    			 if (data.sysUser.account!=null&&data.sysUser.account!="") {
    				 $('#old_Phone').text(data.sysUser.account );//为更改弹出框赋值
    				 $('#P_phone').prepend(data.sysUser.account );
				}
    			  if (data.sysUser.name!=null&&data.sysUser.name!="") {
    				  $('#P_name').text(data.sysUser.name);
				}
    			  
    			  if (data.sysUser.email !=null&&data.sysUser.email !="") {
    				  $('#P_email').text(data.sysUser.email);
				}
    			  if (data.sysUser.industry !=null&&data.sysUser.industry !="") {
    				  $('#P_industry').text(data.sysUser.industry);
				}
    			  if (data.sysDepartment.name !=null&&data.sysDepartment.name !="") {
    				  $('#P_Department').text(data.sysDepartment.name);
				}
    			  if (data.sysUser.job !=null&&data.sysUser.job !="") {
    				  $('#P_job').text(data.sysUser.job);
				}
    			 
    			 if (data.sysRole !=null&&data.sysRole !="") {
    				 var  role = data.sysRole;
       			  var  P_role ="";
       			  for (var i = 0; i < role.length; i++) {
       				  P_role += role[i].name+"  "; 
                       }
       			  $('#P_role').text(P_role);
				}
    			 
    			  
    			 
    			  
    			  
    			  var hobby = eval('('+data.sysUser.hobby+')');
    			 
	    			if (hobby!=null) {
	    				 
	    	    			
	        			  for (var i = 0; i < hobby.length; i++) {
	        				  if (i==0) {
	        					 
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_0)=="宠物"||(hobby[i].hobby_0)=="植物"||(hobby[i].hobby_0)=="户外"||(hobby[i].hobby_0)=="电影"||(hobby[i].hobby_0)=="美食") {
	        						 
	        						  $(".key>li>img[name = '" +hobby[i].hobby_0+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}else {
	    							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_0+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	    						     $(".key").append(html);
	    						}
	    					}
	        				  if (i==1) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_1)=="宠物"||(hobby[i].hobby_1)=="植物"||(hobby[i].hobby_1)=="户外"||(hobby[i].hobby_1)=="电影"||(hobby[i].hobby_1)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_1+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}else {
	    							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_1+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	    						     $(".key").append(html);
	    						}
	    					}
	        				  if (i==2) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_2)=="宠物"||(hobby[i].hobby_2)=="植物"||(hobby[i].hobby_2)=="户外"||(hobby[i].hobby_2)=="电影"||(hobby[i].hobby_2)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_2+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_2+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==3) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_3)=="宠物"||(hobby[i].hobby_3)=="植物"||(hobby[i].hobby_3)=="户外"||(hobby[i].hobby_3)=="电影"||(hobby[i].hobby_3)=="美食") {
	        						 
	        						  $(".key>li>img[name = '" +hobby[i].hobby_3+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_3+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==4) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_4)=="宠物"||(hobby[i].hobby_4)=="植物"||(hobby[i].hobby_4)=="户外"||(hobby[i].hobby_4)=="电影"||(hobby[i].hobby_4)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_4+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_4+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==5) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_5)=="宠物"||(hobby[i].hobby_5)=="植物"||(hobby[i].hobby_5)=="户外"||(hobby[i].hobby_5)=="电影"||(hobby[i].hobby_5)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_5+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_5+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==6) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_6)=="宠物"||(hobby[i].hobby_6)=="植物"||(hobby[i].hobby_6)=="户外"||(hobby[i].hobby_6)=="电影"||(hobby[i].hobby_6)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_6+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_6+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==7) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_7)=="宠物"||(hobby[i].hobby_7)=="植物"||(hobby[i].hobby_7)=="户外"||(hobby[i].hobby_7)=="电影"||(hobby[i].hobby_7)=="美食") {
	        						  
	        						  $(".key>li>img[name = '" +hobby[i].hobby_7+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_7+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  if (i==8) {
	        					  if ((hobby[i].hobby_0)==""||(hobby[i].hobby_8)=="宠物"||(hobby[i].hobby_8)=="植物"||(hobby[i].hobby_8)=="户外"||(hobby[i].hobby_8)=="电影"||(hobby[i].hobby_8)=="美食") {
	        						 
	        						  $(".key>li>img[name = '" +hobby[i].hobby_8+"']").attr("src","../sys/register/images/s_check_no.png");
	    						}
	        					  else {
	     							 html = "<li><img src='${pageContext.request.contextPath}/images/system/s_check_no.png' class='s_fk_pic5' />"+hobby[i].hobby_8+"<img class='k_del' src='${pageContext.request.contextPath}/images/system/k_close.png'/></li>"
	     						     $(".key").append(html);
	     						}
	    					}
	        				  
	        				  
	        				
	        				
	                        }
					}
    			  
    		  }
                 
    		  }); 
    	   var len = $('.key>li').length;
    	  
           if(len>=8){
               $('.s_keyword span').hide();
               $('.s_keyword em').show();
               $('.s_keyword input').hide();
           }
      })
    </script>
    <script type="text/javascript">
    var auths = "<%=session.getAttribute("authoritys")%>";
    </script>
</body>
</html>
